package com.uwlaser.service.mapper;

import com.uwlaser.base.CommonMapper;
import com.uwlaser.domain.CraftParamDetail;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.Set;

/**
* @author zk-Qin
* @date 2022-05-11
*/
@Repository
public interface CraftParamDetailMapper extends CommonMapper<CraftParamDetail> {
    @Select("SELECT c.* FROM craft_param_detail c LEFT JOIN product_params pp ON c.id = pp.param_detail_id LEFT JOIN product_model p ON pp.product_model_id = p.id WHERE p.product_code = #{productCode}")
    Set<CraftParamDetail> queryCraftParamDetail(String productCode);

    @Select("SELECT c.* FROM product_params pp LEFT JOIN craft_param_detail c ON c.id = pp.param_detail_id WHERE c.params_id = #{paramsId}")
    Set<CraftParamDetail> selectLink(Integer paramsId);

    CraftParamDetail selectGearData(String productCode);
}
